<?php
session_start();
$servername = "localhost";
$username = "root";
$conn = mysql_connect($servername,$username)or die(mysql_error());
mysql_select_db("irgc",$conn);
$sql="UPDATE  `irgc`.`user` SET  `status` =  '0' WHERE  `user`.`username` ='".$_SESSION['username']."';"; //status is column that indicate OFFline or ONline of an user(0:off ,1:on)
$result=mysql_query($sql,$conn) or die(mysql_error());	
session_destroy();
header('Location:index.php');
?>